Problem Note 34395: The 'index' output vector in CALL SORTNDX can lose its value and be reset to zero if it is reassigned to a new vector
The 'index' output parameter in CALL SORTNDX is not assigned an element size. Therefore, if you reassign the vector to a new vector, the values are lost and assigned to zeroes.
The problem is illustrated in this example:
proc iml;
m = { 1 1 0,
2 0 0,
1 3 1,
2 2 2 };
call SORTNDX(index, m, {1 3}, {3} );
newindex = index;
print index newindex;
quit;
To circumvent the problem, initialize the 'index' output parameter before issuing the call:
proc iml;
m = { 1 1 0,
2 0 0,
1 3 1,
2 2 2 };
index=0;
call SORTNDX(index, m, {1 3}, {3} );
newindex = index;
print index newindex;
quit;
Operating System and Release Information
SAS System | SAS/IML | z/OS | 9 TS M0 | 9.2 TS2M2 |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9 TS M0 | 9.2 TS2M2 |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9 TS M0 | 9.2 TS2M2 |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9 TS M0 | 9.2 TS2M2 |
Microsoft Windows 2000 Advanced Server | 9 TS M0 | |
Microsoft Windows 2000 Datacenter Server | 9 TS M0 | |
Microsoft Windows 2000 Server | 9 TS M0 | |
Microsoft Windows 2000 Professional | 9 TS M0 | |
Microsoft Windows NT Workstation | 9 TS M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9 TS M0 | 9.2 TS2M2 |
Microsoft Windows Server 2003 Enterprise Edition | 9 TS M0 | 9.2 TS2M2 |
Microsoft Windows Server 2003 Standard Edition | 9 TS M0 | 9.2 TS2M2 |
Microsoft Windows XP Professional | 9 TS M0 | 9.2 TS2M2 |
64-bit Enabled AIX | 9 TS M0 | 9.2 TS2M2 |
64-bit Enabled HP-UX | 9 TS M0 | 9.2 TS2M2 |
64-bit Enabled Solaris | 9 TS M0 | 9.2 TS2M2 |
HP-UX IPF | 9 TS M0 | 9.2 TS2M2 |
Linux | 9 TS M0 | 9.2 TS2M2 |
OpenVMS Alpha | 9 TS M0 | 9.2 TS2M2 |
Tru64 UNIX | 9 TS M0 | 9.2 TS2M2 |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Type: | Problem Note |
Priority: | high |
Topic: | Analytics ==> Matrix Programming
|
Date Modified: | 2009-12-18 10:14:47 |
Date Created: | 2009-01-07 15:16:08 |